using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;

namespace AuthorizeNET {
	public static class GeneralLookup {
		public static string GetEnumTypeString(Enum type) {
			FieldInfo info = type.GetType().GetField(type.ToString());

			DescriptionAttribute[] attributes = (DescriptionAttribute[])info.GetCustomAttributes(typeof(DescriptionAttribute), false);
			if (attributes != null && attributes.Length != 0) return (attributes[0].Description);
			else return (type.ToString());
		}
	}
}
